home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d939.lha
/
ExtraCmds
/
source_etc.lha
/
src
/
BumpRev.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-17
|
3KB
|
97 lines
/*rx
* BumpRev.rexx - a subset of the BumpRev developer command
* Copyright (C) 1993 Torsten Poulin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* The author can be contacted by s-mail at
* Torsten Poulin
* Banebrinken 99, 2, 77
* DK-2400 Copenhagen NV
* DENMARK
*
*/
if left(address(), 4) ~== 'WSH_' then address command
parse arg version name
if ~(datatype(version, 'Whole') & name ~= "") then do
say 'Usage: BumpRev.rexx <version> <file>'
say 'Output: <file>_rev.rev and <file>_rev.h'
exit 20
end
revnumfile=strip(name'_rev.rev')
revfile=strip(name'_rev.h')
if ~exists(revnumfile) then
revnum = 0
else do
if open(nfile, revnumfile, 'Read') then do
revnum = readln(nfile)
call close(nfile)
end
else do
say 'error reading' revnumfile
exit 10
end
end
revnum = revnum + 1
if open(nfile, revnumfile, 'Write') then do
call writeln(nfile, revnum)
call close(nfile)
end
else do
say 'error writing' revnumfile
exit 10
end
if open(hfile, revfile, 'Write') then do
call outputheaderfile
call close(nfile)
end
else do
say 'error writing' revfile
exit 10
end
say name 'bumped to' version'.'revnum
exit 0
outputheaderfile:
name = reverse(name)
parse var name name ':' .
parse var name name '/' .
name = reverse(name)
parse value date('European') with day '/' month '/' year
day=strip(day, 'L', '0')
month=strip(month, 'L', '0')
year=strip(year, 'L', '0')
today=day'.'month'.'year
namever=name version'.'revnum
call writeln(hfile, '#define VERSION' version)
call writeln(hfile, '#define REVISION' revnum)
call writeln(hfile, '#define DATE' '"'today'"')
call writeln(hfile, '#define VERS' '"'namever'"')
call writeln(hfile, '#define VSTRING' '"'namever '('today')\n\r"')
call writeln(hfile, '#define VERSTAG "\0$VER:' namever '('today')"')
return